#include "trap.h"
   .set noat
   .globl main
   .text
main:

    li $s0, 0x80000000
    li $s1, 0x7fffffff
    li $s2, 0x3fffffff
    li $s3, 0x80000000

    # $hi=0x3fff_ffff
    # $lo=0x8000_0000
    mult $s0, $s1

MFHI:
    mfhi $s5
    beq $s5, $s2, MFLO
    j   FALSE
MFLO:
    mflo $s6
    beq $s6, $s3, MTHI
    j   FALSE
MTHI:
    li $s7, 0xffffffff
    mthi $s7
    mfhi $t0
    beq $s7, $t0, MTLO
    j   FALSE
MTLO:
    li $t1, 0x6
    mtlo $t1
    mflo $t2
    beq $t1, $t2, SUCCESS
    j   FALSE

FALSE:
    HIT_BAD_TRAP
SUCCESS: 
    HIT_GOOD_TRAP		#stop temu